X-Git-Url: http://git.cyclocoop.org//%22http:/%22.attribut_html%28%24lesurls%5B%24numero%5D%29.%22/%22?a=blobdiff_plain;f=includes%2Flogging%2FLogEntry.php;h=c672ef7fc9876c429c009b6961e44f9252b6f662;hb=6c169ee1fd84dcf82596edc8c696eff40f2b9aed;hp=395110b9a4a43cad83164cf73613c4c98e27cae6;hpb=05bdcdbbd9c52f14b6de3897187b90174f49130a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php index 395110b9a4..c672ef7fc9 100644 --- a/includes/logging/LogEntry.php +++ b/includes/logging/LogEntry.php @@ -213,6 +213,30 @@ class DatabaseLogEntry extends LogEntryBase { } } + /** + * Loads a LogEntry with the given id from database + * + * @param int $id + * @param IDatabase $db + * @return DatabaseLogEntry|null + */ + public static function newFromId( $id, IDatabase $db ) { + $queryInfo = self::getSelectQueryData(); + $queryInfo['conds'] += [ 'log_id' => $id ]; + $row = $db->selectRow( + $queryInfo['tables'], + $queryInfo['fields'], + $queryInfo['conds'], + __METHOD__, + $queryInfo['options'], + $queryInfo['join_conds'] + ); + if ( !$row ) { + return null; + } + return self::newFromRow( $row ); + } + /** @var stdClass Database result row. */ protected $row; @@ -761,7 +785,7 @@ class ManualLogEntry extends LogEntryBase { // Log the autopatrol if the log entry is patrollable if ( $this->getIsPatrollable() && - $rc->getAttribute( 'rc_patrolled' ) === 1 + $rc->getAttribute( 'rc_patrolled' ) === 2 ) { PatrolLog::record( $rc, true, $this->getPerformer() ); }